<?php

namespace app\controller\v1\admin;


use app\BaseController;
use app\common\Send;
use app\service\SysIntroService;
use think\App;
use think\Request;
use app\validate\SysIntro as SysIntroValidate;
class SysIntro extends BaseController
{
    use Send;
    protected $sysIntroService;

    public function __construct(App $app, SysIntroService $sysIntroService)
    {
        parent::__construct($app);
        $this->sysIntroService = $sysIntroService;
    }

    public function save(Request $request)
    {
        $data = $request->param();
        (new SysIntroValidate)->goCheck($data);
        return self::success($this->sysIntroService->save($data));
    }

    public function index(Request $request)
    {
        return self::success($this->sysIntroService->index());
    }
}
